﻿using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;

namespace NavLine.Aircraft
{
	static class Program
	{
		/// <summary>
		/// The main entry point for the application.
		/// </summary>
		[STAThread]
		static void Main()
		{
			//for (int i = 0; i < 36; i+=10)
			{
				V3G p1 = new V3G(20, 20);
				V3G P2 = new V3G(19.9, 19.99);
				Console.WriteLine(p1.GetHeading(P2));
			}
			//return;
			V3G center = new V3G(20, 20);
			MapPlot plot = new MapPlot(new V3G(20,20), 5e4);
			plot.CreateBMP(600, 600);

			for (int N = 0; N < 2; N++)
			{
				AC_Config cfg = new AC_Config();
				cfg.ROT = 3;
				cfg.BankT = 1+N*20;
				AC ac = new AC(cfg, center, 100, 300);
				List<V3G> pts = new List<V3G>();
				File.Create("log.txt").Close();
				for (int i = 0; i < 10000; i++)
				{
					if (i == 500)
						ac.GoLineSegment(6000, 1000, new V3G(19.7, 20), new V3G(19.7, 20.3), new V3G(20.2, 20.3), new V3G(19.7, 19.7));
					ac.Process(0.5);
					if (!ac.position.Valid)
					{
					}
					pts.Add(ac.position);
				}
				plot.DrawStrip(pts.ToArray());
			}
			plot.Save("res.png");
			return;
			Application.EnableVisualStyles();
			Application.SetCompatibleTextRenderingDefault(false);
			new TestForm().Run(false);
		}
	}
}